unit ufSampleWizardPage;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UIWizard, StdCtrls, ComCtrls, ExtCtrls;

type
  TSampleWizardPage = class(TForm,IWizardPage,IWizardNextPage)
    PanelChoice: TPanel;
    edIntroduction: TRichEdit;
    cbNextPage: TComboBox;
    lblNextPage: TLabel;
  private
    { Private declarations }
    fWizMgr : IWizardManager;
  public
    procedure SetWizardManager(Mgr: IWizardManager);
    procedure NextPageEvent;
    { Public declarations }

  end;

var
  SampleWizardPage: TSampleWizardPage;

implementation

{$R *.dfm}
{ TSampleWizardPage }

procedure TSampleWizardPage.NextPageEvent;
begin
  // This is where you would normally save any data on the page.  Normally
  // each wizard page will be added to the delete stack and taken care of
  // as soon as the program message loop executes.  If this is not desired,
  // then you can call the WizardManager method SetAllowDeletion(False) to
  // delay any deletion until later.  Typically this will not be necessary
  // unless the next form performs a Application.processsMessages call before
  // this method is complete.
  fWizMgr.NavigateToPage(cbNextPage.Text);
end;

procedure TSampleWizardPage.SetWizardManager(Mgr: IWizardManager);
begin
  fWizMgr := Mgr;
  fWizMgr.SetNextEnabled(True); // the next button defaults to being disabled.
  // Any specific load or initialization of this page can go here.

end;

initialization
  // the following line will allow the wizard system to find this form class
  // WITHOUT requiring this be added to anything other than the project.
  RegisterClass(TSampleWizardPage);
end.
